export function  getLists({ aid, roleid }).then(res => {
  res.data.forEach(function (item) {
    const imgReg = /<img.*?(?:>|\/>)/gi
    const srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i
    const str = item.contents
    const arr = str.match(imgReg)
    const srcArr = []
    for (let i = 0; i < arr.length; i++) {
      const src = arr[i].match(srcReg)
      // 获取图片地址
      srcArr.push(`http:${src[1]}`)
    }
    item.imgs = srcArr
    const textRegex = /<\/?.+?\/?>/gm
    const subst = ''
    const textResult = str.replace(textRegex, subst)
    item.text = textResult
  })
})
export default{getLists}